﻿namespace VisualPhysics.Scene.Core.Tests

open System
open System.Drawing
open VisualPhysics.Scene.Core
open VisualPhysics.Scene.Core.Operators
open VisualPhysics.Scene.Core.Tests.Utils
open NUnit.Framework
open FsUnit

type [<TestFixture>] ``ConstantAcceleration tests``() =

    [<Test>]
    [<Category("ACM.CA")>]
    member t.``ConstantAcceleration of -10<m / s ^ 2>, acceleration at 1<s>``() =
        let ca = ConstantAcceleration(-10.0<cm / s ^ 2>, 0.0)
        let acm = ca :> AccelerationManager
        acm.GetAcceleration(1.0<s>)
        |> equalMVectors (-10.0<cm / s ^ 2>, 0.0)
        |> should equal (-10.0<cm / s ^ 2>, 0.0)

    [<Test>]
    [<Category("ACM.CA")>]
    member t.``ConstantAcceleration of -10<m / s ^ 2>, velocity at 1<s>``() =
        let ca = ConstantAcceleration(-10.0<cm / s ^ 2>, Math.PI)
        let acm = ca :> AccelerationManager
        acm.GetVelocity 1.0<s> (0.0<cm / s>, 0.0)
        |> equalMVectors (10.0<cm / s>, Math.PI)
        |> should equal (10.0<cm / s>, Math.PI)

    [<Test>]
    [<Category("ACM.CA")>]
    member t.``ConstantAcceleration of -10<m / s ^ 2>, position at 1<s>``() =
        let ca = ConstantAcceleration(-10.0<cm / s ^ 2>, 0.0)
        let acm = ca :> AccelerationManager
        acm.GetPosition 1.0<s> (0.0<cm / s>, 0.0) (0.0<cm>, 0.0)
        |> equalMVectors (5.0<cm>, Math.PI)
        |> should equal (5.0<cm>, Math.PI)